Nav = {
	page: function (route, title){
        $('main_title').text(title);
        Nav.history.push([route, title]);
        Nav.showBackIconOrNot();
	},
    back: function (controller){
        $('main_title').text(title);

        if (Nav.history.length > 0) {
            var arr = Nav.history.pop();
            var route =  arr[0];
            var title =  arr[1];
            controller.transitionToRoute(route, {main: 'slideRight'});
            $('main_title').text(title);
        }
        Nav.showBackIconOrNot();
    },
    showBackIconOrNot: function() {
        if (Nav.history.length > 0) {
            $('.main_title_icon_left').show();
        } else {
            $('.main_title_icon_left').hide();
        }
    },
    resetBackIcon: function() {
        Nav.history = [];
        Nav.showBackIconOrNot();
    },
    history: []
};
